#!/bin/bash
## kola:
##   # appendFirstbootKernelArgs is only supported on qemu
##   platforms: qemu
##   # Append BOOTIF kernel argument so we can test how nm-initrd-generator
##   # and the coreos-teardown-initramfs interact. The MAC address is the
##   # default one QEMU assigns.
##   # Add rd.neednet=1 so we can force networking to be brought up on
##   # qemu to test that doing so doesn't materially change things.
##   appendFirstbootKernelArgs: "BOOTIF=52:54:00:12:34:56 rd.neednet=1"
#
# In addition to the pure network defaults case we should also make
# sure that when BOOTIF= or rd.bootif= are provided on the kernel
# command line (typically from PXE servers) that we don't propagate
# networking configs either. See https://github.com/coreos/fedora-coreos-tracker/issues/1048

set -xeuo pipefail

# shellcheck disable=SC1091
. "$KOLA_EXT_DATA/commonlib.sh"

# Run the test bits (sets the $fail var)
. $KOLA_EXT_DATA/test-net-propagation.sh

if [ -z "${fail:-}" ]; then
    ok "success: no initramfs network propagation for default configuration with BOOTIF"
else
    fatal "fail: no initramfs network propagation for default configuration with BOOTIF"
fi
